package com.example.websocket;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author Jason
 * @PACKAGE_NAME com.chatroomspringboot
 * @Description 开启WebSocket支持
 * @date 2023-11-23 18:07
 */
@Configuration
public class WebSocketConfig {

    /*作用：注入ServerEndpointExporter bean对象 ，自动注册使用了@ServerEndpoint注解的bean*/
    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }

}
